#pragma once

#include "png8cropfx.h"
#include "imgsource.h"

namespace png8crop
{

	class cropctx
	{
	protected:
		imgsource * const image;
		size2d scale;

		int num_crops;
		crop *crops;

		crop *cropbuf_alloc;

	public:
		cropctx(imgsource *image);
		~cropctx(void);
		
		void load_context(FILE* crpfile);
		void save_context(FILE* crpfile);

		void export_crops(const _TCHAR* output_fmt);
	};

}